import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 课程信息信息 */
export interface Course {
          courseId: number; // 课程ID
          courseName?: string; // 课程名称
  }

// 课程信息 API
export const CourseApi = {
  // 查询课程信息分页
  getCoursePage: async (params: any) => {
    return await request.get({ url: `/ao/course/page`, params })
  },

  // 查询课程信息详情
  getCourse: async (id: number) => {
    return await request.get({ url: `/ao/course/get?id=` + id })
  },

  // 新增课程信息
  createCourse: async (data: Course) => {
    return await request.post({ url: `/ao/course/create`, data })
  },

  // 修改课程信息
  updateCourse: async (data: Course) => {
    return await request.put({ url: `/ao/course/update`, data })
  },

  // 删除课程信息
  deleteCourse: async (id: number) => {
    return await request.delete({ url: `/ao/course/delete?id=` + id })
  },

  /** 批量删除课程信息 */
  deleteCourseList: async (ids: number[]) => {
    return await request.delete({ url: `/ao/course/delete-list?ids=${ids.join(',')}` })
  },

  // 导出课程信息 Excel
  exportCourse: async (params) => {
    return await request.download({ url: `/ao/course/export-excel`, params })
  },
}